#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==================================================
# @File    : assert_type
# @IDE     : PyCharm
# @Author  : liuxiangui
# @Date    : 2023/11/26 18:18
# @Describe: 
# ==================================================
from typing import Any, Union, Text


def equals(check_value: Any, expect_value: Any, message: Text = ""):
    """判断是否相等"""
    assert check_value == expect_value, message


def less_than(check_value: Union[int, float], expect_value: Union[int, float], message: Text = ""):
    """判断实际结果小于预期结果"""
    assert check_value < expect_value, message


def less_than_or_equals(check_value: Union[int, float], expect_value: Union[int, float], message: Text = ""):
    """判断实际结果小于等于预期结果"""
    assert check_value <= expect_value, message


def greater_than(check_value: Union[int, float], expect_value: Union[int, float], message: Text = ""):
    """判断实际结果大于预期结果"""
    assert check_value > expect_value, message


def greater_than_or_equals(check_value: Union[int, float], expect_value: Union[int, float], message: Text = ""):
    """判断实际结果大于等于预期结果"""
    assert check_value >= expect_value, message


def not_equals(check_value: Any, expect_value: Any, message: Text = ""):
    """判断实际结果不等于预期结果"""
    assert check_value != expect_value, message


def contains(check_value: Any, expect_value: Any, message: Text = ""):
    """判断预期是否在实际结果中"""
    assert isinstance(check_value, (list, tuple, dict, str, bytes)), "check_value 需要为  list/tuple/dict/str/bytes  类型"
    assert expect_value in check_value, message


def contains_by(check_value: Any, expect_value: Any, message: Text = ""):
    """判断实际结果是否在预期列表中"""
    assert isinstance(expect_value, (list, tuple, dict, str, bytes)), "expect_value 需要为  list/tuple/dict/str/bytes  类型"
    assert check_value in expect_value, message
